﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  Name="FileIOPermission"
  xmlns="http://schemas.microsoft.com/pag/gax-core"
  Bound="false">
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>FileIO Permission</Caption>
  <Description>Adds a FileIOPermission to the project. Controls the ability to access files and folders. </Description>
  <HostData Priority="220">
    <Icon File="Help/Icons/icon_Advanced.ico" />
    <CommandBar Menu="SPSFSolutionSecurity"/>
    <CommandBar Menu="SPSFProjectSecurity"/>
    <spsf:MetaData
      Visible="true"
      BindingType="CustomizationReference"
      BindingTypeTemplate="CustomizationReferenceTemplate"
      TestType="BaseCustomizationRecipeRunner"
      Enabled="true"
      CreateVSTemplate="false"
      Category="Security" xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[The recipe adds a line for the permission to the Package.Template.xml (for VS 2010 projects) or to the file CASPolicy.txt (for HIVE projects). Warning: Existing permissions with the same name are replaced completely.]]>
      </spsf:WebPageContent>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <xi:include href="../../BaseArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <xi:include href="BasePermissionArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Argument Name="FilePermissionRead" >
      <ValueProvider Type="Evaluator" Expression="C:\TEMP;$AppDir$" />
    </Argument>
    <Argument Name="FilePermissionWrite" >
      <ValueProvider Type="Evaluator" Expression="$AppDir$" />
    </Argument>
    <Argument Name="FilePermissionAppend" >
      <ValueProvider Type="Evaluator" Expression="$AppDir$" />
    </Argument>
    <Argument Name="FilePermissionPathDiscovery" >
      <ValueProvider Type="Evaluator" Expression="$AppDir$" />
    </Argument>

  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Height="350">
          <Title>Policy Settings</Title>
          <Fields>
            <Field Label="Branding" ValueName="SPSFBranding" PanelType="SPALM.SharePointSoftwareFactory.Library.BrandingPanel, SPALM.SharePointSoftwareFactory.Library" />
            <Field ValueName="FilePermissionRead" Label="Read" >
              <Help>Optional text. Read access to the contents of the file or access to information about the file, such as its length or last modification time.</Help>
            </Field>
            <Field ValueName="FilePermissionWrite" Label="Write" >
              <Help>Optional text. Write access to the contents of the file or access to change information about the file, such as its name. Also allows for deletion and overwriting.</Help>
            </Field>
            <Field ValueName="FilePermissionAppend" Label="Append" >
              <Help>Optional text. Ability to write to the end of a file only. No ability to read.</Help>
            </Field>
            <Field ValueName="FilePermissionPathDiscovery" Label="Path Discovery" >
              <Help>Optional text. Access to the information in the path itself. This helps protect sensitive information in the path, such as user names, as well as information about the directory structure revealed in the path. This value does not grant access to files or folders represented by the path.</Help>
            </Field>
            <Field ValueName="PermissionIsUnrestricted" Label="Unrestricted" >
              <Help>Optional Boolean. If Unrestricted is true, the other settings will be ignored.</Help>
            </Field>
          </Fields>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="ConditionalCoordinator">

    <xi:include href="../../BaseStartingActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Action
       Name="AddCASPolicyAction"
       Type="AddCASPolicyAction"
       TemplateFileName="Text\Security\FileIOPermission.txt.t4">
    </Action>

    <xi:include href="../../BaseFinalActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

  </Actions>
</Recipe>